<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网格布局-对齐方式</title>
    <style>
        .box{
            width: 600px;
            height: 600px;
            /* background: red; */
            border: 5px solid gray;
            display: grid;
            grid-template-rows: repeat(3,100px);
            grid-template-columns: repeat(3,100px);

            /* grid-auto-flow: column; 改变网格顺序为列 默认行row */
            

            /* justify-content: center; */
            /* 调整主轴对齐方向  默认start*/
            /* align-content: center; */
            /* 调整侧轴对齐方向 */
            place-content: center center;

            /* justify-items: center; */
            /* align-items: center; */
            /* 以上说网格里的项目居中 */
            place-items: center center;
        }
        .box div{
            border: 1px solid green;   
            width: 50px;
            height: 50px;   
            text-align: center;    
            line-height: 50px;
        }
        
    </style>
</head>
<body>
    <div class="box">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
        <div>7</div>
        <div>8</div>
        <div>9</div>

    </div>
</body>
</html>